﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace GSdk.Shared
{
    public static class StringExtensionMethods
    {
        private static Regex m_WordCounter;
        public static int CountWords(this string input)
        {
            if (m_WordCounter == null)
                m_WordCounter = new Regex(@"[\S]+");

            return m_WordCounter.Matches(input).Count;
        }
    }
}
